home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / ULARN.ARJ / ULARN.TAR / ularn / store.c < prev    next >
C/C++ Source or Header  |  1989-10-25  |  29KB  |  1,264 lines

  1. /*    store.c        */
  2. #include "header.h"
  3.  
  4. static int dndcount=0,dnditm=0;
  5.  
  6. /*    this is the data for the stuff in the dnd store    */
  7. int maxitm=92;    /* number of items in the dnd inventory table    */
  8.  
  9. struct _itm itm[92] = {
  10. /*cost      memory   iven name    iven arg      how
  11.    gp      pointer  iven[]    ivenarg[]     many */
  12. { 2,    0,    OLEATHER,    0,        3    } ,
  13. { 10,    0,    OSTUDLEATHER,    0,        2    } ,
  14. { 40,    0,    ORING,        0,        2    } ,
  15. { 85,    0,    OCHAIN,        0,        2    } ,
  16. { 220,    0,    OSPLINT,    0,        1    } ,
  17. { 400,    0,    OPLATE,        0,        1    } ,
  18. { 900,    0,    OPLATEARMOR,    0,        1    } ,
  19. { 2600,    0,    OSSPLATE,    0,        1    } ,
  20. { 150,    0,    OSHIELD,    0,        1    } ,
  21. { 5000, 0,      OELVENCHAIN,    0,          0    } ,
  22. { 1000, 0,    OORB,        0,        0    } ,
  23. { 10000,0,    OSLAYER,    0,        0    } ,
  24.  
  25. /*cost      memory     iven name    iven arg   how
  26.   gp     pointer      iven[]    ivenarg[]  many */
  27.  
  28. { 2,    0,    ODAGGER,        0,    3    } ,
  29. { 20,    0,    OSPEAR,            0,    3    } ,
  30. { 80,    0,    OFLAIL,            0,    2    } ,
  31. { 150,    0,    OBATTLEAXE,        0,    2    } ,
  32. { 450,    0,    OLONGSWORD,        0,    2    } ,
  33. { 1000,    0,    O2SWORD,        0,    2    } ,
  34. { 5000,    0,    OSWORD,            0,    1    } ,
  35. { 20000,0,    OLANCE,            0,    1    } ,
  36. { 2000,    0,    OSWORDofSLASHING,    0,    0    } ,
  37. { 7500, 0,    OHAMMER,        0,    0    } ,
  38.  
  39. /*cost      memory     iven name    iven arg   how
  40.   gp     pointer      iven[]    ivenarg[]  many */
  41. { 150,    0,    OPROTRING,    1,    1    } ,
  42. { 85,    0,    OSTRRING,    1,    1    } ,
  43. { 120,    0,    ODEXRING,    1,    1    } ,
  44. { 120,    0,    OCLEVERRING,    1,    1    } ,
  45. { 180,    0,    OENERGYRING,    0,    1    } ,
  46. { 125,    0,    ODAMRING,    0,    1    } ,
  47. { 220,    0,    OREGENRING,    0,    1    } ,
  48. { 1000,    0,    ORINGOFEXTRA,    0,    1        } ,
  49.  
  50. { 280,    0,    OBELT,        0,    1        } ,
  51. { 400,    0,    OAMULET,    5,    1        } ,
  52.  
  53. { 500,    0,    OCUBEofUNDEAD,    0,    0        } ,
  54. { 600,    0,    ONOTHEFT,    0,    0        } ,
  55.  
  56. { 590,    0,    OCHEST,        3,    1        } ,
  57. { 200,    0,    OBOOK,        2,    1        } ,
  58. { 10,    0,    OCOOKIE,    0,    3        } ,
  59. { 666,  0,    OHANDofFEAR,    0,    0        } ,
  60.  
  61.     /*cost      memory     iven name    iven arg   how
  62.       gp     pointer      iven[]    ivenarg[]  many */
  63.  
  64. { 20,    potionname,    OPOTION,    0,    6        } ,
  65. { 90,    potionname,    OPOTION,    1,    5        } ,
  66. { 520,    potionname,    OPOTION,    2,    1        } ,
  67. { 100,    potionname,    OPOTION,    3,    2        } ,
  68. { 50,    potionname,    OPOTION,    4,    2        } ,
  69. { 150,    potionname,    OPOTION,    5,    2        } ,
  70. { 70,    potionname,    OPOTION,    6,    1        } ,
  71. { 30,    potionname,    OPOTION,    7,    7        } ,
  72. { 200,    potionname,    OPOTION,    8,    1        } ,
  73. { 50,    potionname,    OPOTION,    9,    1        } ,
  74. { 80,    potionname,    OPOTION,    10,    1        } ,
  75.  
  76. /*cost      memory     iven name    iven arg   how
  77.   gp     pointer      iven[]    ivenarg[]  many */
  78.  
  79. { 30,    potionname,    OPOTION,    11,    3        } ,
  80. { 20,    potionname,    OPOTION,    12,    5        } ,
  81. { 40,    potionname,    OPOTION,    13,    3        } ,
  82. { 35,    potionname,    OPOTION,    14,    2        } ,
  83. { 520,    potionname,    OPOTION,    15,    1        } ,
  84. { 90,    potionname,    OPOTION,    16,    2        } ,
  85. { 200,    potionname,    OPOTION,    17,    2        } ,
  86. { 220,    potionname,    OPOTION,    18,    4        } ,
  87. { 80,    potionname,    OPOTION,    19,    6        } ,
  88. { 370,    potionname,    OPOTION,    20,    3        } ,
  89. { 50,    potionname,    OPOTION,    22,    1        } ,
  90. { 150,    potionname,    OPOTION,    23,    3        } ,
  91.  
  92. /*cost      memory     iven name    iven arg   how
  93.   gp     pointer      iven[]    ivenarg[]  many */
  94.  
  95. { 850,    0,        OORBOFDRAGON,    0,    0        } ,
  96. { 750,    0,        OSPIRITSCARAB,    0,    0        } ,
  97. { 8000, 0,        OVORPAL,    0,    0,        } ,
  98.  
  99. { 100,    scrollname,    OSCROLL,    0,    2        } ,
  100. { 125,    scrollname,    OSCROLL,    1,    2        } ,
  101. { 60,    scrollname,    OSCROLL,    2,    4        } ,
  102. { 10,    scrollname,    OSCROLL,    3,    4        } ,
  103. { 100,    scrollname,    OSCROLL,    4,    3        } ,
  104. { 200,    scrollname,    OSCROLL,    5,    2        } ,
  105. { 110,    scrollname,    OSCROLL,    6,    1        } ,
  106. { 500,    scrollname,    OSCROLL,    7,    2        } ,
  107. { 200,    scrollname,    OSCROLL,    8,    2        } ,
  108. { 250,    scrollname,    OSCROLL,    9,    4        } ,
  109. { 20,    scrollname,    OSCROLL,    10,    5        } ,
  110. { 30,    scrollname,    OSCROLL,    11,    3        } ,
  111.  
  112. /*cost      memory     iven name    iven arg   how
  113.   gp     pointer      iven[]    ivenarg[]  many */
  114.  
  115. { 340,    scrollname,    OSCROLL,    12,    1    } ,
  116. { 340,    scrollname,    OSCROLL,    13,    1    } ,
  117. { 300,    scrollname,    OSCROLL,    14,    2    } ,
  118. { 400,    scrollname,    OSCROLL,    15,    2    } ,
  119. { 500,    scrollname,    OSCROLL,    16,    2    } ,
  120. { 1000,    scrollname,    OSCROLL,    17,    1    } ,
  121. { 500,    scrollname,    OSCROLL,    18,    1    } ,
  122. { 340,    scrollname,    OSCROLL,    19,    2    } ,
  123. { 220,    scrollname,    OSCROLL,    20,    3    } ,
  124. { 3900,    scrollname,    OSCROLL,    21,    0    } ,
  125. { 610,    scrollname,    OSCROLL,    22,    1    } ,
  126. { 3000,    scrollname,    OSCROLL,    23,    0    } ,
  127. { 300,  0,        OSPHTALISMAN,   0,    0    } ,
  128. { 150,  0,        OWWAND,        0,    0    } ,
  129. { 50,    0,        OBRASSLAMP,    0,    0    } ,
  130. { 9500, 0,        OPSTAFF,    0,    0    } 
  131. };
  132.  
  133. /*
  134.     function for the dnd store
  135.  */
  136. dnd_2hed()
  137. {
  138. lprcat("Welcome to the Ularn Thrift Shoppe.  We stock many items explorers find useful\n");
  139. lprcat("in their adventures.  Feel free to browse to your hearts content.\n");
  140. lprcat("Also be advised, if you break 'em, you pay for 'em.");
  141. }
  142.  
  143. dnd_hed()
  144. {
  145.     register int i;
  146.  
  147.     for (i=dnditm; i<26+dnditm; i++)    
  148.         dnditem(i);
  149.     cursor(50,18); 
  150.     lprcat("You have ");
  151. }
  152.  
  153. dndstore()
  154. {
  155.     register int i;
  156.  
  157.     dnditm = 0;
  158.     nosignal = 1; /* disable signals */
  159.     clear();  
  160.     dnd_2hed();
  161.     if (outstanding_taxes>0)
  162.     {
  163. lprcat("\n\nThe Ularn Revenue Service has ordered us to not do business with tax evaders.\n"); 
  164.         beep();
  165. lprintf("They have also told us that you owe %d gp in back taxes, and as we must\n",(long)outstanding_taxes);
  166. lprcat("comply with the law, we cannot serve you at this time.  Soo Sorry.\n");
  167.         cursors();    
  168.         lprcat("\nPress "); 
  169.         standout("escape"); 
  170.         lprcat(" to leave: "); 
  171.         lflush();
  172.         i=0;
  173.         while (i!='\33') i=getcharacter();
  174.         drawscreen();  
  175.         nosignal = 0; /* enable signals */
  176.         return;
  177.     }
  178.     dnd_hed();
  179.     while (1) {
  180.         cursor(59,18); 
  181.         lprintf("%d gold pieces",(long)c[GOLD]);
  182.         cltoeoln(); 
  183.         cl_dn(1,20);    /* erase to eod */
  184.         lprcat("\nEnter your transaction ["); 
  185.         standout("space");
  186.         lprcat(" for more, "); 
  187.         standout("escape");
  188.         lprcat(" to leave]? ");
  189.         i=0;
  190.         while ((i<'a' || i>'z') && (i!=' ') && (i!='\33') && (i!=12))  
  191.             i=getcharacter();
  192.         if (i==12) { 
  193.             clear();  
  194.             dnd_2hed();  
  195.             dnd_hed(); 
  196.         }
  197.         else if (i=='\33') {     
  198.             drawscreen();  
  199.             nosignal = 0; /* enable signals */
  200.  
  201.             return; 
  202.         }
  203.         else if (i==' ') {
  204.             cl_dn(1,4);
  205.             if ((dnditm += 26) >= maxitm) 
  206.                 dnditm=0; 
  207.             dnd_hed();
  208.         }
  209.         else
  210.         {  /* buy something */
  211.             lprc(i);    /* echo the byte */
  212.             i += dnditm - 'a';
  213.             if (i>=maxitm) 
  214.                 outofstock(); 
  215.             else if (itm[i].qty <= 0) 
  216.                 outofstock(); 
  217.             else if (pocketfull()) 
  218.                 handsfull(); 
  219.             else if (c[GOLD] < itm[i].price*10) 
  220.                 nogold(); 
  221.             else {     
  222.                 if (itm[i].mem != 0) 
  223.                     *itm[i].mem[itm[i].arg] = ' ';
  224.                 c[GOLD] -= itm[i].price*10;
  225.                 itm[i].qty--;  
  226.                 take(itm[i].obj,itm[i].arg);
  227.                 if (itm[i].qty==0) 
  228.                     dnditem(i);  
  229.                 nap(1001);
  230.             }
  231.         }
  232.  
  233.     }
  234. }
  235.  
  236. /*
  237.     function for the players hands are full
  238.  */
  239. handsfull()
  240. {     
  241.     lprcat("\nYou can't carry anything more!"); 
  242.     lflush(); 
  243.     nap(2200); 
  244. }
  245. outofstock()
  246. {     
  247.     lprcat("\nSorry, but we are out of that item."); 
  248.     lflush(); 
  249.     nap(2200); 
  250. }
  251. nogold()
  252. {     
  253.     lprcat("\nYou don't have enough gold to pay for that!"); 
  254.     lflush(); 
  255.     nap(2200); 
  256. }
  257.  
  258. /*
  259.     dnditem(index)
  260.  
  261.     to print the item list;  
  262.     used in dndstore() enter with the index into itm
  263. */
  264. dnditem(i)
  265. register int i;
  266. {
  267.     register int j,k;
  268.  
  269.     if (i >= maxitm)  
  270.         return;
  271.     cursor( (j=(i&1)*40+1) , (k=((i%26)>>1)+5) );
  272.     if (itm[i].qty == 0)  {     
  273.         lprintf("%39s","");  
  274.         return; 
  275.     }
  276.     lprintf("%c) ",(i%26)+'a');
  277.     if (itm[i].obj == OPOTION) {     
  278.         lprcat("potion of "); 
  279.         lprintf("%s",&potionname[itm[i].arg][1]); 
  280.     }
  281.     else if (itm[i].obj == OSCROLL) {     
  282.         lprcat("scroll of "); 
  283.         lprintf("%s",&scrollname[itm[i].arg][1]); 
  284.     }
  285.     else lprintf("%s",objectname[itm[i].obj]);
  286.     cursor( j+31,k );  
  287.     lprintf("%6d",(long)(itm[i].price*10));
  288. }
  289.  
  290.  
  291. /*
  292.     for the college of larn
  293.  */
  294. char course[26]={0};    /*    the list of courses taken    */
  295. char coursetime[] = { 10, 15, 10, 20, 10, 10, 10, 5 };
  296.  
  297. /*
  298.     function to display the header info for the school
  299.  */
  300. sch_hed()
  301. {
  302.     clear();
  303. lprcat("The College of Ularn offers the exciting opportunity of higher education to\n");
  304. lprcat("all inhabitants of the caves.  Here is a list of the class schedule:\n\n\n");
  305.     lprcat("\t\t    Course Name \t       Time Needed\n\n");
  306.  
  307.     /*line 7 of crt*/
  308.     if (course[0]==0) 
  309.         lprcat("\t\ta)  Fighters Training I         10 mobuls"); 
  310.     lprc('\n');
  311.     if (course[1]==0) 
  312.         lprcat("\t\tb)  Fighters Training II        15 mobuls");
  313.     lprc('\n');
  314.     if (course[2]==0) 
  315.         lprcat("\t\tc)  Introduction to Wizardry    10 mobuls");
  316.     lprc('\n');
  317.     if (course[3]==0) 
  318.         lprcat("\t\td)  Applied Wizardry            20 mobuls");
  319.     lprc('\n');
  320.     if (course[4]==0) 
  321.         lprcat("\t\te)  Behavioral Psychology       10 mobuls");
  322.     lprc('\n');
  323.     if (course[5]==0) 
  324.         lprcat("\t\tf)  Faith for Today             10 mobuls");
  325.     lprc('\n');
  326.     if (course[6]==0) 
  327.         lprcat("\t\tg)  Contemporary Dance          10 mobuls");
  328.     lprc('\n');
  329.     if (course[7]==0) 
  330.         lprcat("\t\th)  History of Ularn              5 mobuls");
  331.  
  332.     lprcat("\n\n\t\tAll courses cost 250 gold pieces.");
  333.     cursor(30,18);
  334.     lprcat("You are presently carrying ");
  335. }
  336.  
  337. oschool()
  338. {
  339.     register int i;
  340.  
  341.     long time_used;
  342.     nosignal = 1; /* disable signals */
  343.     sch_hed();
  344.     while (1) {
  345.         cursor(57,18); 
  346.         lprintf("%d gold pieces.   ",(long)c[GOLD]); 
  347.         cursors();
  348.         lprcat("\nWhat is your choice ["); 
  349.         standout("escape");
  350.         lprcat(" to leave] ? ");  
  351.         yrepcount=0;
  352.         i=0;  
  353.         while ((i<'a' || i>'h') && (i!='\33') && (i!=12)) 
  354.             i=getcharacter();
  355.         if (i==12) { 
  356.             sch_hed();  
  357.             continue; 
  358.         }
  359.         else if (i=='\33') {     
  360.             nosignal = 0; 
  361.             drawscreen();  /* enable signals */
  362.  
  363.             return; 
  364.         }
  365.         lprc(i);
  366.         if (c[GOLD] < 250)  
  367.             nogold();  
  368.         else
  369.             if (course[i-'a']) {     
  370.                 lprcat("\nSorry, but that class is filled."); 
  371.                 nap(1000); 
  372.             }
  373.             else if (i <= 'h') {
  374.                 c[GOLD] -= 250; 
  375.                 time_used=0;
  376.                 switch(i) {
  377.                 case 'a':
  378.                     c[STRENGTH] += 2;  
  379.                     c[CONSTITUTION]++;
  380.                     lprcat("\nYou feel stronger!");
  381.                     cl_line(16,7);
  382.                     break;
  383.  
  384.                 case 'b':
  385.                     if (course[0]==0) {
  386.                         lprcat("\nSorry, but this class has a prerequisite of Fighters Training I");
  387.                         c[GOLD]+=250;  
  388.                         time_used= -10000;  
  389.                         break;
  390.                     }
  391.                     lprcat("\nYou feel much stronger!");
  392.                     cl_line(16,8);
  393.                     c[STRENGTH] += 2;  
  394.                     c[CONSTITUTION] += 2;  
  395.                     break;
  396.  
  397.                 case 'c':
  398.                     c[INTELLIGENCE] += 2; 
  399.                     lprcat("\nThe task before you now seems more attainable!");
  400.                     cl_line(16,9);  
  401.                     break;
  402.  
  403.                 case 'd':
  404.                     if (course[2]==0) {
  405.                         lprcat("\nSorry, but this class has a prerequisite of Introduction to Wizardry");
  406.                         c[GOLD]+=250;  
  407.                         time_used= -10000;  
  408.                         break;
  409.                     }
  410.                     lprcat("\nThe task before you now seems very attainable!");
  411.                     cl_line(16,10);
  412.                     c[INTELLIGENCE] += 2;  
  413.                     break;
  414.  
  415.                 case 'e':
  416.                     c[CHARISMA] += 3;  
  417.                     lprcat("\nYou now feel like a born leader!");
  418.                     cl_line(16,11);  
  419.                     break;
  420.  
  421.                 case 'f':
  422.                     c[WISDOM] += 2;  
  423.                     lprcat("\nYou now feel more confident that you can find the potion in time!");
  424.                     cl_line(16,12);  
  425.                     break;
  426.  
  427.                 case 'g':
  428.                     c[DEXTERITY] += 3;  
  429.                     lprcat("\nYou feel like dancing!");
  430.                     cl_line(16,13);  
  431.                     break;
  432.  
  433.                 case 'h':
  434.                     c[INTELLIGENCE]++;
  435.                     lprcat("\nWow!! E = MC^2!!!\n");
  436.                     cl_line(16,14);  
  437.                     break;
  438.                 }
  439.                 time_used += coursetime[i-'a']*100;
  440.                 if (time_used > 0) {
  441.                     gtime += time_used;
  442.                     /*remember that he has taken that course*/
  443.                     course[i-'a']++;
  444.                     /* he regenerated */ 
  445.                     c[HP] = c[HPMAX];  
  446.                     c[SPELLS] = c[SPELLMAX]; 
  447.  
  448.                     /* cure blindness too!  */
  449.                     if (c[BLINDCOUNT])    
  450.                         c[BLINDCOUNT]=1;  
  451.  
  452.                     /*    end confusion    */
  453.                     if (c[CONFUSE])    
  454.                         c[CONFUSE]=1;    
  455.  
  456.                     /* adjust parameters for time change */
  457.                     adjtime((long)time_used);    
  458.                 }
  459.                 nap(1000);
  460.             }
  461.     }
  462. }
  463.  
  464. /*
  465.  *    for the first national bank of Ularn
  466.  */
  467. int lasttime=0;    /* last time he was in bank */
  468. obank()
  469. {
  470.     banktitle("    Welcome to the First National Bank of Ularn.");
  471. }
  472. obank2() 
  473. {
  474. banktitle("Welcome to the 8th level branch office of the First National Bank of Ularn.");
  475. }
  476.  
  477. banktitle(str)
  478. char *str;
  479. {
  480.     nosignal = 1; /* disable signals */
  481.     clear();  
  482.     lprcat(str);
  483.     if (outstanding_taxes>0) {
  484.         register int i;
  485. lprcat("\n\nThe Ularn Revenue Service has ordered that your account be frozen until all\n"); 
  486.         beep();
  487. lprintf("levied taxes have been paid.  They have also told us that you owe %d gp in\n",(long)outstanding_taxes);
  488. lprcat("taxes, and we must comply with them. We cannot serve you at this time.  Sorry.\n");
  489. lprcat("We suggest you go to the LRS office and pay your taxes.\n");
  490.         cursors();    
  491.         lprcat("\nPress "); 
  492.         standout("escape"); 
  493.         lprcat(" to leave: "); 
  494.         lflush();
  495.         i=0;
  496.         while (i!='\33') 
  497.             i=getcharacter();
  498.         drawscreen();  
  499.         nosignal = 0; /* enable signals */
  500.  
  501.         return;
  502.     }
  503.     lprcat("\n\n\tGemstone\t      Appraisal\t\tGemstone\t      Appraisal");
  504.     obanksub();        
  505.     nosignal = 0; /* enable signals */
  506.     drawscreen();
  507. }
  508.  
  509. /*
  510.  *    function to put interest on your bank account
  511.  */
  512. ointerest()
  513. {
  514.     register int i;
  515.  
  516.     if (c[BANKACCOUNT]<0) 
  517.         c[BANKACCOUNT] = 0;
  518.     else if ((c[BANKACCOUNT]>0) && (c[BANKACCOUNT]<1000000)) {
  519.         i = (gtime-lasttime)/100; /* # mobuls elapsed */
  520.         while ((i-- > 0) && (c[BANKACCOUNT]<1000000))
  521.             c[BANKACCOUNT] += c[BANKACCOUNT]/250;
  522.         if (c[BANKACCOUNT]>1000000) 
  523.             c[BANKACCOUNT]=1000000; /* interest limit */
  524.     }
  525.     lasttime = (gtime/100)*100;
  526. }
  527.  
  528. static short gemorder[26]={0};    /* the reference to screen location for each */
  529. static long gemvalue[26]={0};    /* the appraisal of the gems */
  530.  
  531. obanksub()
  532. {
  533.     long amt;
  534.     register int i,k;
  535.     ointerest();    /* credit any needed interest */
  536.  
  537.     if (level==8) c[TELEFLAG] = 0;
  538.  
  539.     for (k=i=0; i<26; i++)
  540.         switch(iven[i]) {
  541.         case OLARNEYE: 
  542.         case ODIAMOND: 
  543.         case OEMERALD: 
  544.         case ORUBY: 
  545.         case OSAPPHIRE: 
  546.             if (iven[i]==OLARNEYE) {     
  547.                 gemvalue[i]=250000-((gtime*7)/100)*100;
  548.                 if (gemvalue[i]<50000) 
  549.                     gemvalue[i]=50000;
  550.             }
  551.             else gemvalue[i] = (255&ivenarg[i])*100;
  552.             gemorder[i]=k;
  553.             cursor( (k%2)*40+1 , (k>>1)+4 );
  554.             lprintf("%c) %s",i+'a',objectname[iven[i]]);
  555.             cursor( (k%2)*40+33 , (k>>1)+4 );
  556.             lprintf("%5d",(long)gemvalue[i]);  
  557.             k++;
  558.         };
  559.     cursor(31,17); 
  560.     lprintf("You have %8d gold pieces in the bank.",(long)c[BANKACCOUNT]);
  561.     cursor(40,18); 
  562.     lprintf("You have %8d gold pieces",(long)c[GOLD]);
  563.     if (c[BANKACCOUNT]+c[GOLD] >= 500000)
  564.         lprcat("\nNote:  Ularndom law states that only deposits under 1,000,000gp  can earn interest.");
  565.     while (1) {
  566.         cl_dn(1,20);
  567.         lprcat("\nYour wish? [("); 
  568.         standout("d"); 
  569.         lprcat(") deposit, (");
  570.         standout("w"); 
  571.         lprcat(") withdraw, ("); 
  572.         standout("s");
  573.         lprcat(") sell a stone, or "); 
  574.         standout("escape"); 
  575.         lprcat("]  ");
  576.         yrepcount=0;
  577.         i=0; 
  578.         while (i!='d' && i!='w' && i!='s' && i!='\33') 
  579.             i=getcharacter();
  580.         switch(i) {
  581.         case 'd':
  582.             lprcat("deposit\nHow much? ");    
  583.             amt = readnum((long)c[GOLD]);
  584.             if (amt < 0) { 
  585.                 lprcat("\nSorry, but we can't take negative gold!"); 
  586.                 nap(2000); 
  587.                 amt=0; 
  588.             } 
  589.             else if (amt>c[GOLD]) {     
  590.                 lprcat("  You don't have that much."); 
  591.                 nap(2000); 
  592.             } 
  593.             else {     
  594.                 c[GOLD] -= amt;  
  595.                 c[BANKACCOUNT] += amt; 
  596.             }
  597.             break;
  598.  
  599.         case 'w':
  600.             lprcat("withdraw\nHow much? ");    
  601.             amt = readnum((long)c[BANKACCOUNT]);
  602.             if (amt<0) {     
  603.                 lprcat("\nSorry, but we don't have any negative gold!");  
  604.                 nap(2000); 
  605.                 amt=0; 
  606.             }
  607.             else if (amt > c[BANKACCOUNT]) {     
  608.                 lprcat("\nYou don't have that much in the bank!"); 
  609.                 nap(2000); 
  610.             }
  611.             else {     
  612.                 c[GOLD] += amt;  
  613.                 c[BANKACCOUNT] -= amt; 
  614.             }        
  615.             break;
  616.  
  617.         case 's':
  618.             lprcat("\nWhich stone would you like to sell? ");
  619.             i=0; 
  620.             while ((i<'a' || i>'z') && i!='*') 
  621.                 i=getcharacter();
  622.             if (i=='*')
  623.                 for (i=0; i<26; i++) {     
  624.                     if (gemvalue[i]) {
  625.                         if (iven[i]==OLARNEYE) {
  626.                         monstnamelist[DEMONLORD]=' ';
  627.                         monstnamelist[DEMONLORD+1]=' ';
  628.                         monstnamelist[DEMONLORD+2]= ' ';
  629.                         monstnamelist[DEMONLORD+3]= ' ';
  630.                         monstnamelist[DEMONLORD+4]= ' ';
  631.                         monstnamelist[DEMONLORD+5]= ' ';
  632.                         monstnamelist[DEMONLORD+6]= ' ';
  633.                         monstnamelist[DEMONPRINCE]= ' ';
  634.                         monstnamelist[LUCIFER] = ' ';
  635.                         }
  636.                         c[GOLD]+=gemvalue[i];  
  637.                         iven[i]=0;
  638.                         gemvalue[i]=0;    
  639.                         k = gemorder[i];
  640.                         cursor( (k%2)*40+1 , (k>>1)+4 );
  641.                         lprintf("%39s","");
  642.                     }
  643.                 }
  644.             else { 
  645.                 if (gemvalue[i=i-'a']==0) {
  646.                   lprintf("\nItem %c is not a gemstone!",i+'a');
  647.                     nap(2000); 
  648.                     break;
  649.                 }
  650.                 if (iven[i]==OLARNEYE) {
  651.                     monstnamelist[DEMONLORD]=' ';
  652.                     monstnamelist[DEMONLORD+1]=' ';
  653.                     monstnamelist[DEMONLORD+2]= ' ';
  654.                     monstnamelist[DEMONLORD+3]= ' ';
  655.                     monstnamelist[DEMONLORD+4]= ' ';
  656.                     monstnamelist[DEMONLORD+5]= ' ';
  657.                     monstnamelist[DEMONLORD+6]= ' ';
  658.                     monstnamelist[DEMONPRINCE]= ' ';
  659.                     monstnamelist[LUCIFER] = ' ';
  660.                 }
  661.                 c[GOLD]+=gemvalue[i];  
  662.                 iven[i]=0;
  663.                 gemvalue[i]=0;    
  664.                 k = gemorder[i];
  665.                 cursor( (k%2)*40+1 , (k>>1)+4 ); 
  666.                 lprintf("%39s","");
  667.             }
  668.             break;
  669.         case '\33':
  670.             return;
  671.         };
  672.         cursor(40,17); 
  673.         lprintf("%8d",(long)c[BANKACCOUNT]);
  674.         cursor(49,18); 
  675.         lprintf("%8d",(long)c[GOLD]);
  676.     }
  677. }
  678.  
  679. /*
  680.     subroutine to appraise any stone for the bank
  681.  */
  682. appraise(gemstone)
  683. int gemstone;
  684. {
  685.     register int j,amt;
  686.  
  687.     for (j=0; j<26; j++)
  688.         if (iven[j]==gemstone) {
  689.             lprintf("\nI see you have %s",objectname[gemstone]);
  690.             if (gemstone==OLARNEYE) 
  691.                 lprcat("  I must commend you.  I didn't think\nyou could get it.");
  692.             lprcat("  Shall I appraise it for you? ");  
  693.             yrepcount=0;
  694.             if (getyn()=='y') {
  695.                 lprcat("yes.\n  Just one moment please \n");  
  696.                 nap(1000);
  697.                 if (gemstone==OLARNEYE) {
  698.                     amt = 250000-((gtime*7)/100)*100;
  699.                     if (amt<50000) amt=50000;
  700.                 }
  701.                 else amt = (255 & ivenarg[j]) * 100;
  702.                 lprintf("\nI can see this is an excellent stone, It is worth %d",(long)amt);
  703.                 lprcat("\nWould you like to sell it to us? ");  
  704.                 yrepcount=0;
  705.                 if (getyn()=='y') { 
  706.                     lprcat("yes\n"); 
  707.                     c[GOLD]+=amt;  
  708.                     iven[j]=0; 
  709.                 }
  710.                 else lprcat("no thank you.\n");
  711.                 if (gemstone==OLARNEYE) lprcat("It is, of course, your privilege to keep the stone\n"); 
  712.             }
  713.             else lprcat("no\nO. K.\n");
  714.         }
  715. }
  716. /*
  717.     function for the trading post
  718.  */
  719. otradhead()
  720. {
  721.     clear();
  722. lprcat("Welcome to the Ularn Trading Post.  We buy items that explorers no longer find\n");
  723. lprcat("useful.  Since the condition of the items you bring in is not certain,\n");
  724. lprcat("and we incur great expense in reconditioning the items, we usually pay\n");
  725. lprcat("only 20% of their value were they to be new.  If the items are badly\n");
  726. lprcat("damaged, we will pay only 10% of their new value.\n\n");
  727. }
  728.  
  729. otradepost()
  730. {
  731.     int i,j,value,isub,izarg;
  732.  
  733.     dnditm = dndcount = 0;
  734.     nosignal = 1; /* disable signals */
  735.     resetscroll();    
  736.     otradhead();
  737.     while (1) {
  738.         lprcat("\nWhat item do you want to sell to us ["); 
  739.         standout("*");
  740.         lprcat(" for list, or "); 
  741.         standout("escape"); 
  742.         lprcat("] ? ");
  743.         i=0; 
  744.         while (i>'z' || (i<'a' && i!='*' && i!='\33' && i!='.')) 
  745.             i=getcharacter();
  746.         if (i == '\33') {     
  747.             setscroll(); 
  748.             recalc(); 
  749.             drawscreen(); 
  750.             nosignal=0; /* enable signals */
  751.  
  752.             return; 
  753.         }
  754.         isub = i - 'a';        
  755.         j=0;
  756.         if (iven[isub]==OSCROLL) 
  757.             if (scrollname[ivenarg[isub]][0]==0) {     
  758.                 j=1; 
  759.                 cnsitm(); 
  760.             }    /* can't sell unidentified item */
  761.         if (iven[isub]==OPOTION) 
  762.             if (potionname[ivenarg[isub]][0]==0) {     
  763.                 j=1; 
  764.                 cnsitm(); 
  765.             }    /* can't sell unidentified item */
  766.         if (!j)
  767.             if (i=='*') {     
  768.                 clear(); 
  769.                 qshowstr(); 
  770.                 otradhead(); 
  771.             }
  772.             else  if (iven[isub]==0)  
  773.                 lprintf("\nYou don't have item %c!",isub+'a');
  774.             else {
  775.                 for (j=0; j<maxitm; j++)
  776.                     if ((itm[j].obj == iven[isub]) || 
  777.                         (iven[isub] == ODIAMOND) || 
  778.                         (iven[isub] == ORUBY) || 
  779.                         (iven[isub] == OEMERALD) || 
  780.                         (iven[isub] == OSAPPHIRE)) {
  781.                         srcount=0;  
  782.                         show3(isub);    /* show what the item was */
  783.                         if ((iven[isub] == ODIAMOND) 
  784.                             || (iven[isub] == ORUBY) 
  785.                             || (iven[isub] == OEMERALD) 
  786.                             || (iven[isub] == OSAPPHIRE))
  787.                             value = 20*ivenarg[isub];
  788.                         else if ((itm[j].obj == OSCROLL) 
  789.                             || (itm[j].obj == OPOTION))  
  790.                             value = 2*itm[j+ivenarg[isub]].price;
  791.                         else {
  792.                             izarg=ivenarg[isub];  
  793.                             /* appreciate if a +n object */
  794.                             value = itm[j].price;    
  795.                             if (izarg >= 0) value *= 2;
  796.                             while ((izarg-- > 0) && ((value=14*(67+value)/10) < 500000))
  797.                                 ;
  798.                         }
  799.                         lprintf("\nItem (%c) is worth %d gold pieces to us.  Do you want to sell it? ",i,(long)value);
  800.                         yrepcount=0;
  801.                         if (getyn()=='y') {
  802.                             lprcat("yes\n"); 
  803.                             c[GOLD]+=value;
  804.                             if (c[WEAR] == isub) c[WEAR] = -1;
  805.                             if (c[WIELD] == isub) c[WIELD] = -1;
  806.                             if (c[SHIELD] == isub) c[SHIELD] = -1;
  807.                             adjustcvalues(iven[isub],ivenarg[isub]);
  808.                             iven[isub]=0;
  809.                         }
  810.                         else lprcat("no thanks.\n");
  811.                         j = maxitm+100;    /* get out of the inner loop */
  812.                     }
  813.                 if (j <= maxitm+2) lprcat("\nSo sorry, but we are not authorized to accept that item.");
  814.             }
  815.     }
  816. }
  817.  
  818. cnsitm()
  819.     lprcat("\nSorry, we can't accept unidentified objects."); 
  820. }
  821.  
  822. /*
  823.  *    for the Ularn Revenue Service
  824.  */
  825. olrs()
  826. {
  827.     register int i,first;
  828.     long amt;
  829.  
  830.     first = nosignal = 1; /* disable signals */
  831.     clear();  
  832.     resetscroll(); 
  833.     cursor(1,4);
  834.     if (outstanding_taxes)
  835.         if (cheat) {
  836. lprcat("Sorry, but it seems you are trying to pay off your taxes by cheating!");
  837.             lprcat("\n\n\tpress [escape] to exit the office.");
  838.             cursors();
  839.             i=0; 
  840.             while (i!='\33') 
  841.                 i=getcharacter();
  842.             nosignal = 0; /* enable signals */
  843.             setscroll(); 
  844.             drawscreen();    
  845.             return;
  846.         }
  847.     lprcat("Welcome to the Ularn Revenue Service district office.  How can we help you?");
  848.     while (1) {
  849.         if (first) { 
  850.             first=0; 
  851.             goto nxt; 
  852.         }
  853.         cursor(1, 20);
  854.         lprcat("\n\nYour wish? [(");
  855.         standout("p");
  856.         lprcat(") pay taxes, or ");
  857.         standout("escape");
  858.         lprcat("]  ");  
  859.         yrepcount=0;
  860.         i=0; 
  861.         while (i!='p' && i!='\33') 
  862.             i=getcharacter();
  863.         switch(i) {
  864.         case 'p':    
  865.             lprcat("pay taxes\nHow much? "); 
  866.             amt = readnum((long)c[GOLD]);
  867.             if (amt<0) { 
  868.             lprcat("\nSorry, but we can't take negative gold\n"); 
  869.                 amt=0; 
  870.             } 
  871.             else
  872.                 if (amt>c[GOLD])    
  873.                     lprcat("  You don't have that much.\n");
  874.                 else  c[GOLD] -= paytaxes((long)amt);
  875.             break;
  876.         case '\33':    
  877.             nosignal = 0; /* enable signals */
  878.             setscroll(); 
  879.             drawscreen();    
  880.             return;
  881.         };
  882.  
  883. nxt:    
  884.         cursor(1,6);
  885.         if (outstanding_taxes>0)
  886.     lprintf("You presently owe %d gp in taxes.  ",(long)outstanding_taxes);
  887.         else
  888.             lprcat("You do not owe us any taxes.           ");
  889.         cursor(1,8);
  890.         if (c[GOLD]>0)
  891.             lprintf("You have %6d gp.    ",(long)c[GOLD]);
  892.         else
  893.             lprcat("You have no gold pieces.  ");
  894.     }
  895. }
  896.  
  897.  
  898. nomore()
  899. {
  900.     lprcat("\nSorry man, I ain't got no more of that shit.");
  901.     lflush(); 
  902.     nap(2200); 
  903. }
  904. nocash()
  905. {     
  906.     lprcat("\nWhattaya trying to pull on me? You aint got the cash!");
  907.     lflush(); 
  908.     nap(1200);
  909. }
  910.  
  911. /*
  912.     Dealer McDopes Pad
  913.  */
  914. /*
  915.     function to display the header info for the pad
  916.  */
  917. char drug[5]={0};
  918. pad_hd()
  919. {
  920.     clear();
  921.     lprcat("Hey man, welcome to Dealer McDope's Pad!  I gots the some of the finest shit\n");
  922.     lprcat("you'll find anywhere in Ularn - check it out...\n\n\n");
  923.     lprcat("\t\t    The Stash\t\t\tThe Cash\n\n");
  924.  
  925.     /*line 7 of crt*/
  926.     if (drug[0]==0) lprcat("\t\ta)  Killer Speed\t\t100 bucks");
  927.     lprc('\n');
  928.     if (drug[1]==0) lprcat("\t\tb)  Groovy Acid\t\t\t250 bucks");
  929.     lprc('\n');
  930.     if (drug[2]==0) lprcat("\t\tc)  Monster Hash\t\t500 bucks");
  931.     lprc('\n');
  932.     if (drug[3]==0) lprcat("\t\td)  Trippy Shrooms\t\t1000 bucks");
  933.     lprc('\n');
  934.     if (drug[4]==0) lprcat("\t\te)  Cool Coke\t\t\t5000 bucks");
  935.     lprc('\n');
  936.  
  937.     cursor(30,18);
  938.     lprcat("Looks like you got about ");
  939. }
  940.  
  941. opad()
  942. {
  943.     register int i,flag;
  944.  
  945.     nosignal = 1; /* disable signals */
  946.  
  947.     pad_hd();
  948.  
  949.     while (1) {
  950.         cursor(57,18); 
  951.         lprintf("%d bucks on you.   ",(long)c[GOLD]); 
  952.         cursors();
  953.         lprcat("\nSo, whatdya want [escape");
  954.         lprcat(" to split] ? ");  
  955.         yrepcount=0;
  956.  
  957.         i=flag=0;
  958.  
  959.         while ((i<'a' || i>'e') && (i!='\33') && (i!=12)) 
  960.             i=getcharacter();
  961.  
  962.         if (i==12) { 
  963.             pad_hd();  
  964.             continue; 
  965.         }
  966.         else if (i=='\33') {     
  967.             nosignal = 0; 
  968.             drawscreen();  /* enable signals */
  969.             return; 
  970.         }
  971.         lprc(i);
  972.         if (drug[i-'a']) {     
  973.             nomore();
  974.             flag++;
  975.         } 
  976.         else
  977.             switch(i) {
  978.             case 'a': 
  979.                 if (c[GOLD] < 100) {
  980.                     nocash();
  981.                     flag++;
  982.                 } 
  983.                 break;
  984.             case 'b': 
  985.                 if (c[GOLD] < 250) {
  986.                     nocash();
  987.                     flag++;
  988.                 } 
  989.                 break;
  990.             case 'c': 
  991.                 if (c[GOLD] < 500) {
  992.                     nocash();
  993.                     flag++;
  994.                 } 
  995.                 break;
  996.             case 'd': 
  997.                 if (c[GOLD] < 1000) {
  998.                     nocash();
  999.                     flag++;
  1000.                 } 
  1001.                 break;
  1002.             case 'e': 
  1003.                 if (c[GOLD] < 5000) {
  1004.                     nocash();
  1005.                     flag++;
  1006.                 } 
  1007.                 break;
  1008.             }
  1009.         if (flag>0) continue;
  1010.         switch(i) {
  1011.         case 'a':    /* speed */
  1012.             if (snag(OSPEED)) {
  1013.                 c[GOLD] -= 100; 
  1014.                 cl_line(16,7);
  1015.                 flag++;
  1016.             }
  1017.             break;
  1018.  
  1019.         case 'b':    /* acid */
  1020.             if (snag(OACID)) {
  1021.                 c[GOLD] -= 250; 
  1022.                 cl_line(16,8);
  1023.                 flag++;
  1024.             }
  1025.             break;
  1026.  
  1027.         case 'c':    /* hash */
  1028.             if (snag(OHASH)) {
  1029.                 c[GOLD] -= 500; 
  1030.                 cl_line(16,9);  
  1031.                 flag++;
  1032.             }
  1033.             break;
  1034.  
  1035.         case 'd':    /* shrooms */
  1036.             if (snag(OSHROOMS)) {
  1037.                 c[GOLD] -= 1000; 
  1038.                 cl_line(16,10);
  1039.                 flag++;
  1040.             }
  1041.             break;
  1042.  
  1043.         case 'e':    /* coke */
  1044.             if (snag(OCOKE)) {
  1045.                 c[GOLD] -= 5000; 
  1046.                 cl_line(16,11);  
  1047.                 flag++;
  1048.             }
  1049.             break;
  1050.         } /* end switch */
  1051.  
  1052.         /*remember that he has snagged that drug*/
  1053.         if (flag) 
  1054.             drug[i-'a']++;
  1055.         nap(1000);
  1056.     } /*end while(1) */
  1057. } /* end pad() */
  1058.  
  1059. snag(itm)
  1060. int itm;
  1061. {
  1062.     int i,limit;
  1063.  
  1064.     if ( (limit = 15 + (c[LEVEL] >> 1)) > 26) limit=26;
  1065.  
  1066.     for(i=0;i<limit;i++)
  1067.         if (iven[i]==0) {
  1068.             iven[i]=itm;
  1069.             ivenarg[i]=0;
  1070.             limit=0;
  1071.             lprcat("\nOk, here ya go");
  1072.             show3(i);
  1073.             return(1);
  1074.         }
  1075.     lprcat("\nHey, you can't carry anymore");
  1076.     return(0);
  1077. }
  1078.  
  1079. int char_picked = 0;
  1080.  
  1081. pick_char(foo)
  1082. int foo;
  1083. {
  1084.     int i;
  1085.  
  1086.     nosignal = 1; /* disable signals */
  1087.  
  1088.         if (foo == 0) {
  1089.         clear();
  1090.         lprcat("\t\tThe Addiction of Ularn\n\n");
  1091.         lprcat("Pick a character class...\n\n\n");
  1092.         lprcat("\t\t    Character\n\n");
  1093.  
  1094.         lprcat("\t\ta)  Ogre");
  1095.         lprc('\n');
  1096.         lprcat("\t\tb)  Wizard");
  1097.         lprc('\n');
  1098.         lprcat("\t\tc)  Klingon");
  1099.         lprc('\n');
  1100.         lprcat("\t\td)  Elf");
  1101.         lprc('\n');
  1102.         lprcat("\t\te)  Rogue");
  1103.         lprc('\n');
  1104.         lprcat("\t\tf)  Geek");
  1105.         lprc('\n');
  1106.         lprcat("\t\tg)  Dwarf");
  1107.         lprc('\n');
  1108.         lprcat("\t\th)  Rambo");
  1109.         lprc('\n');
  1110.  
  1111.         cursors();
  1112.         lprcat("\nSo, what are ya? ");
  1113.         lflush();
  1114.  
  1115.         while (i<'a' || i>'h') 
  1116.             i=getcharacter();
  1117.  
  1118.        } else { 
  1119.         i = foo;
  1120.         c[SHIELD] = c[WEAR] = c[WIELD] = -1;
  1121.        }
  1122.     switch(i) {
  1123.     case 'a':     /* Ogre */
  1124.         strcpy(char_class, "Ogre");
  1125.         spelknow[1]=1;    /* mle */
  1126.         c[SPELLMAX]=c[SPELLS]=1;
  1127.         c[HPMAX]=c[HP]=16;
  1128.         c[0] = 18;    /* strength */
  1129.         c[1] = 4;    /* intelligence */
  1130.         c[2] = 6;    /* wisdom */
  1131.         c[3] = 16;    /* constitution */
  1132.         c[4] = 6;    /* dexterity */
  1133.         c[5] = 4;    /* charisma */
  1134.         iven[0]=OPOTION;
  1135.         ivenarg[0]=rund(6);
  1136.         iven[1]=OPOTION;
  1137.         ivenarg[1]=rund(6);
  1138.         c[WIELD]=c[WEAR]= -1;
  1139.         break;
  1140.     case 'b':     /* Wizard */
  1141.         strcpy(char_class, "Wizard");
  1142.         spelknow[1]=1;    /* mle */
  1143.         spelknow[4]=1;    /* chm */
  1144.         c[SPELLMAX]=c[SPELLS]=2;
  1145.         c[HPMAX]=c[HP]=8;
  1146.         c[0] = 8;    /* strength */
  1147.         c[1] = 16;    /* intelligence */
  1148.         c[2] = 16;    /* wisdom */
  1149.         c[3] = 6;    /* constitution */
  1150.         c[4] = 6;    /* dexterity */
  1151.         c[5] = 8;    /* charisma */
  1152.         iven[0]=OPOTION;
  1153.         ivenarg[0]=19; /* potion of treasure detection */
  1154.         iven[1]=OSCROLL;
  1155.         ivenarg[1]=rund(6); 
  1156.         iven[2]=OSCROLL;
  1157.         ivenarg[2]=rund(6);
  1158.         c[WIELD]=c[WEAR]= -1;
  1159.         break;
  1160.     case 'c':     /* Klingon */
  1161.         strcpy(char_class, "Klingon");
  1162.         spelknow[5]=1;    /* ssp */
  1163.         c[SPELLMAX]=c[SPELLS]=1;
  1164.         c[HPMAX]=c[HP]=14;
  1165.         c[0] = 14;    /* strength */
  1166.         c[1] = 12;    /* intelligence */
  1167.         c[2] = 4;    /* wisdom */
  1168.         c[3] = 12;    /* constitution */
  1169.         c[4] = 8;    /* dexterity */
  1170.         c[5] = 3;    /* charisma */
  1171.         iven[0]=OSTUDLEATHER;
  1172.         ivenarg[0]=0;
  1173.         iven[1]=OPOTION;
  1174.         ivenarg[1]=rund(6);
  1175.         c[WIELD]= -1;
  1176.         c[WEAR] = 0;
  1177.         break;
  1178.     case 'd':     /* Elf */
  1179.         strcpy(char_class, "Elf");
  1180.         spelknow[0]=1;
  1181.         c[SPELLS]=1;
  1182.         c[SPELLMAX]=2;
  1183.         c[HPMAX]=c[HP]=8;
  1184.         c[0] = 8;    /* strength */
  1185.         c[1] = 14;    /* intelligence */
  1186.         c[2] = 12;    /* wisdom */
  1187.         c[3] = 8;    /* constitution */
  1188.         c[4] = 8;    /* dexterity */
  1189.         c[5] = 14;    /* charisma */
  1190.         iven[0]=OLEATHER;
  1191.         ivenarg[0]=0;
  1192.         iven[1]=OSCROLL;
  1193.         ivenarg[1]=rund(6);
  1194.         c[WIELD]= -1;
  1195.         c[WEAR]=0;
  1196.         break;
  1197.     case 'e':      /* Rogue */
  1198.         strcpy(char_class, "Rogue");
  1199.         spelknow[1]=1; 
  1200.         c[SPELLMAX]=c[SPELLS]=1;
  1201.         c[HPMAX]=c[HP]=12;    
  1202.         c[0] = 8;    /* strength */
  1203.         c[1] = 12;    /* intelligence */
  1204.         c[2] = 8;    /* wisdom */
  1205.         c[3] = 10;    /* constitution */
  1206.         c[4] = 14;    /* dexterity */
  1207.         c[5] = 6;    /* charisma */
  1208.         iven[0]=OLEATHER; 
  1209.         iven[1]=ODAGGER;
  1210.         ivenarg[1]=ivenarg[0]=c[WEAR]=0;  
  1211.         c[WIELD]=1;
  1212.         iven[2]=OSCROLL;
  1213.         ivenarg[2]=14;    /* stealth */
  1214.         break;
  1215.     case 'f':      /* Geek */
  1216.         strcpy(char_class, "Geek");
  1217.         spelknow[0]=1; 
  1218.         spelknow[1]=1; 
  1219.         c[SPELLMAX]=c[SPELLS]=1;
  1220.         c[HPMAX]=c[HP]=10;    
  1221.         c[0] = 12;    /* strength */
  1222.         c[1] = 12;    /* intelligence */
  1223.         c[2] = 12;    /* wisdom */
  1224.         c[3] = 12;    /* constitution */
  1225.         c[4] = 12;    /* dexterity */
  1226.         c[5] = 12;    /* charisma */
  1227.         iven[0]=OLEATHER; 
  1228.         iven[1]=ODAGGER;
  1229.         ivenarg[1]=ivenarg[0]=c[WEAR]=0;  
  1230.         c[WIELD]=1;
  1231.         break;
  1232.     case 'g':      /* Dwarf*/
  1233.         strcpy(char_class, "Dwarf");
  1234.         spelknow[0]=1; 
  1235.         c[SPELLMAX]=c[SPELLS]=1;
  1236.         c[HPMAX]=c[HP]=12;    
  1237.         c[0] = 16;    /* strength */
  1238.         c[1] = 6;    /* intelligence */
  1239.         c[2] = 8;    /* wisdom */
  1240.         c[3] = 16;    /* constitution */
  1241.         c[4] = 4;    /* dexterity */
  1242.         c[5] = 4;    /* charisma */
  1243.         iven[0]=OSPEAR;
  1244.         ivenarg[0]=c[WIELD]=0;
  1245.         break;
  1246.     case 'h':      /* Rambo */
  1247.         strcpy(char_class, "Rambo");
  1248.         c[SPELLMAX]=c[SPELLS]=0;
  1249.         c[HPMAX]=c[HP]=1;
  1250.         c[0] = 3;    /* strength */
  1251.         c[1] = 3;    /* intelligence */
  1252.         c[2] = 3;    /* wisdom */
  1253.         c[3] = 3;    /* constitution */
  1254.         c[4] = 3;    /* dexterity */
  1255.         c[5] = 3;    /* charisma */
  1256.         iven[0]=OLANCE;
  1257.         ivenarg[0]=c[WIELD]=0;
  1258.         c[LANCEDEATH] = 1;
  1259.         break;
  1260.     } /* end switch */
  1261.     nosignal = 0;
  1262. } /* end pick_char */
  1263.